package demo7;

public class test1 {
    public static void main(String[] args) {

        //电话号码判断
        String regex1 = "1[3-9]\\d{9}";
        System.out.println("13112345678".matches(regex1));
        System.out.println("13420672626".matches(regex1));
        System.out.println("13006754622".matches(regex1));
        System.out.println("131123456789".matches(regex1));


        System.out.println("-----------------------------");
        //固话电话号码判断
        //{}中带的是次数等等，云笔记上有
        String regex2 = "0\\d{2,3}-?[1-9]\\d{4,9}";
        System.out.println("020-2324242".matches(regex2));
        System.out.println("02122442".matches(regex2));
        System.out.println("027-42424".matches(regex2));
        System.out.println("0712-3242434".matches(regex2));


        //邮箱判断

        System.out.println("-------------------------------");
        String regex3 = "\\w+@[\\w&&[^_]]{2,6}(\\.[a-zA-Z]{2,3}){1,2}";
        System.out.println("3232323@qq.com".matches(regex3));
        System.out.println("zhangsan@itheima.cnn".matches(regex3));
        System.out.println("dle10009@163.com".matches(regex3));
        System.out.println("dle10009@pc1.com.cn".matches(regex3));

        System.out.println("-----------------------------");
        String regex4="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
        System.out.println("23:11:11".matches(regex4));

    }
}
